<?php
function bet2in ($lotto_id, $btype, $num, $money, $rate, $back, $account)
{
    global $lotto6h;
    $fields = array();
    $fields['lotto_id'] = $lotto_id;
    $fields['createtime'] = systime();
    $fields['bettype'] = $btype;
    $fields['numbers'] = "'" . $num . "'";
    $fields['line_nums'] = "'" . $num . "'";
    $fields['amount'] = $money;
    $fields['rate'] = $rate;
    $fields['back'] = $back;
    $fields['account'] = "'" . $account . "'";
    $newid = db_insert("bet8", $fields);
    $lotto6h->getBet8_6h($newid);
}

if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}
//if ($curruser['prev_id'] != 0)
//{
//    exit();
//}
include_once( "class_6h/class.lotto6h.php" );
$lotto6h = new lotto6h();
$lotto_id = intval($_GET['id']);
$bettype = explode(",", $_GET['bt']);
$numbers = explode(",", $_GET['num']);
$rate = floatval($_GET['rate']);
$back = floatval($_GET['back']);
$amount = intval($_GET['nts']);
$account = $_GET['acc'];
$count = count($numbers);
for ($i = 0; $i < $count; $i++)
{
    if ($bettype[$i] === "" || $numbers[$i] === "" || $rate <= 1 || $amount <= 0)
    {
        continue;
    }
    bet2in($lotto_id, $bettype[$i], $numbers[$i], $amount, $rate, $back, $account);
}
echo "<script>";
echo "alert('走飞存档完成！');";
echo "</script>";
?>